with System;

package body FT2.Bitmaps is

   ----------
   -- Copy --
   ----------

   procedure Copy
     (Library : FT_Library;
      Source : FT_Bitmap;
      Target : out FT_Bitmap;
      Error : out FT_Error)
   is
      function Internal
        (Library : FT_Library;
         Source : FT_Bitmap;
         Target : System.Address)
         return FT_Error;
      pragma Import (C, Internal, "FT_Bitmap_Copy");
   begin
      Error := Internal (Library, Source, Target'Address);
   end Copy;

   --------------
   -- Embolden --
   --------------

   procedure Embolden
     (Library : FT_Library;
      Bitmap : in out FT_Bitmap;
      X_Strength : FT_Pos;
      Y_Strength : FT_Pos;
      Error : out FT_Error)
   is
      function Internal
        (Library : FT_Library;
         Bitmap : System.Address;
         X_Strength : FT_Pos;
         Y_Strength : FT_Pos)
        return FT_Error;
      pragma Import (C, Internal, "FT_Bitmap_Embolden");
   begin
      Error := Internal (Library, Bitmap'Address, X_Strength, Y_Strength);
   end Embolden;

   -------------
   -- Convert --
   -------------

   procedure Convert
     (Library : FT_Library;
      Source : FT_Bitmap;
      Target : in out FT_Bitmap;
      Alignment : FT_Int;
      Error : out FT_Error)
   is
      function Internal
        (Library : FT_Library;
         Source : FT_Bitmap;
         Target : System.Address;
         Alignment : FT_Int)
         return FT_Error;
      pragma Import (C, Internal, "FT_Bitmap_Convert");
   begin
      Error := Internal (Library, Source, Target'Address, Alignment);
   end Convert;

   -----------------
   -- Bitmap_Done --
   -----------------

   procedure Bitmap_Done
     (Library : FT_Library;
      Bitmap : in out FT_Bitmap;
      Error : out FT_Error)
   is
      function Internal
        (Library : FT_Library;
         Bitmap : System.Address)
         return FT_Error;
      pragma Import (C, Internal, "FT_Bitmap_Done");
   begin
      Error := Internal (Library, Bitmap'Address);
   end Bitmap_Done;

end FT2.Bitmaps;
